<!doctype html>
<html>
<head>
<meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no">
<meta charset="utf-8">
<title>奶茶零售管理系统</title>
<link rel="stylesheet" href="./css/app.css">
 <link href="./bootstrap/css/bootstrap.min.css" rel="stylesheet">
     <link href="./css/docs.css" rel="stylesheet">
    <link href="./css/prettify.css" rel="stylesheet">
  
   
       <link href="./css/google-bootstrap.css" rel="stylesheet">
         <link href="./css/select2.css" rel="stylesheet">
<script src="./js/jquery-1.9.1.js" type="text/javascript"></script>
 <script src="./js/ui.js" type="text/javascript"></script>
 <script src="./js/public.js" type="text/javascript"></script>
 <script src="./js/config.js" type="text/javascript"></script>
 <script src="./js/sqlprovider.js" type="text/javascript"></script>

 <script type="text/javascript">
 var _ifContent;
 var _totalnum;
 var _totalrows;
 var _orderno;
 var _totalprice;
 var _selectedrowid;
 var _membertel;
 var _operatetype;//操作类型 add or update or delete
 var touchAdminKey = "";
 var lastTouchAdminTime = new Date(1900);
 function adminEvent(e) {
           
            var touch = e.touches[0];
            var x = touch.screenX;
            var y = touch.screenY;
            if ( y > 71) {
                return;
            }
            var src = _ifContent.src;
			
            if (!(src.indexOf('/teachoose.html') > -1 )) {
                return;
            }
            var now = new Date();
            var ts = now.getTime() - lastTouchAdminTime.getTime();
            if (ts >= 5 * 1000) {
                touchAdminKey = "1";
                lastTouchAdminTime = new Date();
            } else if (ts >= 10) {
                touchAdminKey += "1";
                lastTouchAdminTime = new Date();
            }
            if (touchAdminKey == "1111") {
				if(x<512)
                _ifContent.src = './page/tealist.html';
				else
				 _ifContent.src = './page/daycount.html';
            }
        }
		
		function countSecond( )
{
　 $("Clock").innerHTML=tick();
	//setTimeout()是设定一??指定等候时间(单位是千分之一秒, millisecond), 时间到了, 浏览器就会执行一??指定的method 或 function
　 window.setTimeout("countSecond()", 1000);
}
 function init()
 {
	 $("Clock").innerHTML=tick();
	countSecond();
	 $("topdiv").addEventListener("touchstart", adminEvent, false);
	this.sqlProvider = new SQLProvider();
    this.db = this.sqlProvider.db;
	//this.sqlProvider.loadTable("Drop table ORDER_INFO");
	//this.sqlProvider.loadTable("Drop table ORDER_DETAIL");
	
	this.sqlProvider.createTable('CREATE TABLE IF NOT EXISTS TEA_TYPE(id INTEGER NOT NULL PRIMARY KEY,goods_type VARCHAR(10))'); 
	this.sqlProvider.createTable('CREATE TABLE IF NOT EXISTS TEA_INFO(id INTEGER NOT NULL PRIMARY KEY, code_id VARCHAR(20),goods_name VARCHAR(40),goods_sellperprice DOUBLE(0,2),goods_type VARCHAR(10))'); 
	this.sqlProvider.createTable('CREATE TABLE IF NOT EXISTS TORDER_DETAIL(id INTEGER NOT NULL PRIMARY KEY, goodsid INTEGER NOT NULL,goods_num INTEGER)'); 
	this.sqlProvider.createTable('CREATE TABLE IF NOT EXISTS ORDER_DETAIL(id INTEGER NOT NULL PRIMARY KEY, goodsid INTEGER NOT NULL,goods_num INTEGER,orderid INTEGER)'); 
	this.sqlProvider.createTable('CREATE TABLE IF NOT EXISTS MEMBERCARD_INFO(id INTEGER NOT NULL PRIMARY KEY, tel INTEGER NOT NULL, name VARCHAR(10),credits INTEGER)'); 
	this.sqlProvider.createTable('CREATE TABLE IF NOT EXISTS ORDER_INFO(id INTEGER NOT NULL PRIMARY KEY,tid VARCHAR(10),totalprice DOUBLE(0,2),totalnum INTEGER, membercard VARCHAR(10),paymethod INTEGER,ordertime VARCHAR(20))'); //0表示会员卡积分抵扣 1表示付现金 2表示还未付款
     _ifContent = document.getElementById("ifContent");
	 _admintips="";
	 _membertel = "";
     _ifContent.src = "./page/teachoose.html";
	 
 }
 
 function gotopage(page)
 {
	
	  _ifContent.src = "./page/"+page+".html";
 }
 window.onload=init;
 </script>
</head>

<body onselectstart="return false">
     <div class="container-fluid" style="margin-top:-30px;">
     <div class="row" style="background-image:url(./img/top.png);border:1" id="topdiv">
        <div class="col-xs-6" >
        <img src="./img/topleft.png">
        </div>
           <div class="col-xs-3" style="font-family:微软雅黑;font-size:18px;margin-top:25px"><span id="Clock"></span>
           </div>
           <div class="col-xs-3" >
           <img src="./img/topright.png">
           </div>
     </div></div>
  
      <div class="container-fluid" >
     <div class="row" style="background-image:url(./img/content.png)">
        <div class="col-xs-12" style="height:537px;">
       <iframe id="ifContent" name="ifContent" width="100%" height="100%" allowtransparency="true" frameborder="0" scrolling="no" style="margin-left:-10px;"></iframe>
        </div>
         
     </div></div>
  
</body>
</html>
